package com.cloud.service;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloud.core.BaseService;
import com.cloud.dao.CaseBean;
import com.cloud.dao.PictureBean;
import com.cloud.dao.impl.CaseDao;

/**
 * 1Cloud1
 * @author Administrator
 * @since 2015-12-4
 * @version 1.0 
 */
@Service("CaseService")
public class CaseService extends BaseService{
	private static final Logger logger = LoggerFactory.getLogger(CaseService.class);
	
	@Autowired
	private CaseDao CaseDao;
	
	public List<CaseBean> getCaseList(CaseBean bean){
		logger.debug(String.format("开始查询[%s]的病例[%s]的信息.", bean.getPat_id(), bean.getId()));
		return CaseDao.getCaseList(bean);
	}
	
	public List<PictureBean> getCasePictureList(String case_id){
		logger.debug(String.format("开始查询病例[%s]的图片信息.", case_id));
		return CaseDao.getCasePictureList(case_id);
	}
	
	public void addCase(CaseBean bean){
		CaseDao.addCase(bean);
	}
	
	public void addCasePicture(CaseBean bean){
		CaseDao.addCasePicture(bean);
	}
	
	public void updateCase(CaseBean bean){
		CaseDao.updateCase(bean);
	}
	
	public void deleteCase(CaseBean bean){
		CaseDao.deleteCase(bean);
		deletePicture(bean);
	}

	public void deletePicture(CaseBean bean){
		CaseDao.deletePicture(bean);
	}
}
